package com.hyt.it.ogt.kq.service.bm.feign.tps;

import com.hyt.common.apiInfor.ApiResponse;
import com.hyt.common.utils.result.Result;
import com.hyt.it.ogt.kq.service.bm.feign.tps.model.WeChatMiniAppConfig;
import com.hyt.it.ogt.kq.service.bm.feign.tps.model.WxMiniAppSubscribeMsg;
import com.hyt.it.ogt.kq.service.bm.feign.tps.model.WxOffiaccountTemplateMsg;
import com.hyt.it.ogt.kq.service.bm.model.vo.CallBackParam;
import com.hyt.it.ogt.kq.service.bm.model.vo.InvoiceSaveVo;
import com.hyt.model.tps.entity.InvoiceBase;
import com.hyt.model.tps.entity.PeePayNotify;
import com.hyt.model.tps.vo.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "it-ogt-webcommon",contextId = "bm-it-ogt-webcommon",fallbackFactory = TpsClientHystrix.class)
public interface TpsClient {

	@RequestMapping(value = "/pay/base/pay", method = RequestMethod.POST)
	Object pay(@RequestBody PayRequestVo payBase) throws Exception;

	@RequestMapping(value = "/pay/base/payWechat", method = RequestMethod.POST)
	Object payWechat(@RequestBody PayRequestVo payBase) throws Exception;

	@RequestMapping(value = "/pay/base/payQuery", method = RequestMethod.POST)
	Object payQuery(@RequestBody PayQueryVo queryVo) throws Exception;

	@RequestMapping(value = "/pay/base/refund", method = RequestMethod.POST)
	Object refund(@RequestBody RefundVo queryVo) throws Exception;

	@RequestMapping(value = "/pay/base/analysis", method = RequestMethod.POST)
	Object analysis(@RequestBody Analysis analysis) throws Exception;
	
	@RequestMapping(value = "/pay/base/analysisYopNotifyStr", method = RequestMethod.GET)
	String analysisYopNotifyStr(@RequestParam String analysisYopNotifyStr, @RequestParam String officeId) throws Exception;
	
	@RequestMapping(value = "/pay/base/payProvider", method = RequestMethod.GET)
	String getPayProvider(@RequestParam String officeId) throws Exception;

	@RequestMapping(value = "/wx/request/getQRCode", method = RequestMethod.GET)
	Object getQRCode(@RequestParam String officeId, @RequestParam String scene,@RequestParam String page, @RequestParam  Integer width) throws Exception;

	@RequestMapping(value = "/wx/request/getBmQRCode", method = RequestMethod.GET)
	Object getBmQRCode(@RequestParam String officeId, @RequestParam String scene,@RequestParam String page, @RequestParam  Integer width) throws Exception;
	
	@RequestMapping(value = "/wx/request/getBmQRCodeHwCloud", method = RequestMethod.GET)
	Object getBmQRCodeHwCloud(@RequestParam String officeId, @RequestParam String scene,@RequestParam String page, @RequestParam  Integer width) throws Exception;

	/**
	 * 推送微信小程序订阅消息
	 *
	 * @param wxMiniAppSubscribeMsgs
	 * @return
	 */
	@RequestMapping(value = "/wx/request/pushWxMiniAppSubscribeMessage", method = RequestMethod.POST)
	ApiResponse<Object> pushWxMiniAppSubscribeMessage(@RequestBody List<WxMiniAppSubscribeMsg> wxMiniAppSubscribeMsgs);

	/**
	 * 推送微信小程序订阅消息
	 *
	 * @param wxOffiaccountTemplateMsgs
	 * @return
	 */
	@RequestMapping(value = "/wx/request/pushWeChatOffiAccountTemplateMessage", method = RequestMethod.POST)
	ApiResponse<Object> pushWeChatOffiAccountTemplateMessage(@RequestBody List<WxOffiaccountTemplateMsg> wxOffiaccountTemplateMsgs);

	@RequestMapping(value = "/invoice/base/query", method = RequestMethod.GET)
	InvoiceBase queryInvoiceBase(@RequestParam String officeId) throws Exception;

	@RequestMapping(value = "/invoice/base/invoiceInterface", method = RequestMethod.POST)
	String invoiceInterface(@RequestBody InvoiceSaveVo vo) throws Exception;

	@RequestMapping(value = "/invoice/base/syncInvoiceResult", method = RequestMethod.POST)
	String syncInvoiceResult(@RequestBody CallBackParam param) throws Exception;
	
	@RequestMapping(value = "/invoice/base/syncInvoiceResultV2", method = RequestMethod.POST)
	String syncInvoiceResultV2(@RequestBody CallBackParam param) throws Exception;
	
	

	@RequestMapping(value = "/bucket/getBucketTempCredential", method = RequestMethod.GET)
	String getBucketTempCredential(@RequestParam String officeId) throws Exception;

	//验证签名是否正确
	@RequestMapping(value = "/pay/base/peePayHmac", method = RequestMethod.POST)
	boolean peePayHmac(@RequestBody PeePayNotify peePayNotify) throws Exception;

	/**
	 * 获取报名微信小程序的配置
	 * 
	 * @param officeId 机构ID，这里的机构ID是tps的机构
	 * @param supplierType 产品类型
	 * @return
	 */
	@RequestMapping(value = "/wx/request/getWxConfigByOfficeIdAndType", method = RequestMethod.GET)
	WeChatMiniAppConfig getWxConfig(@RequestParam String officeId, @RequestParam String supplierType);


	@RequestMapping(value = "/bucket/uploadFileToHuawei", method = RequestMethod.PUT)
	Result uploadFileToHuawei(@RequestParam String officeId, @RequestParam String path, @RequestBody byte[] bytes);

	@RequestMapping(value = "/bucket/getbucketInfo", method = RequestMethod.GET)
	String getBucketTempCredential() ;
	
	/**
	 *
	 * @Description:  第三方发送短信微服务接口
	 * @param messageVo
	 * @return 
	 */
	@RequestMapping(value = "/message/base/sendMessage", method = RequestMethod.POST)
	public String sendMessage(@RequestBody MessageVo messageVo);

    /**
     * 获取南昌非税系统私钥
     * @param officeId
     * @return
     */
	@RequestMapping(value = "/pay/base/getNcNonTaxPayPrivateKey", method = RequestMethod.GET)
    String getNcNonTaxPayPrivateKey(String officeId);
	
	   /**
    *
    * @param officeId
    * @param path
    * @param bytes
    * @return
    */
   @PutMapping("/bucket/uploadFileToTencent")
   ApiResponse<String>  uploadFileToTencent(@RequestParam String officeId, @RequestParam String path, @RequestBody byte[] bytes);

}
